<template>
  <Tooltip
    :title="t('操作手册')"
    placement="bottom"
    :mouseEnterDelay="0.5"
    @click="handleHelp"
  >
    <Badge>
      <Icon icon="simple-line-icons:book-open" />
    </Badge>
  </Tooltip>
</template>
<script lang="ts">
  import { defineComponent, onMounted, ref } from 'vue';
  import { Tooltip, Badge } from 'ant-design-vue';
  import Icon from '/@/components/Icon';

  import { useI18n } from '/@/hooks/web/useI18n';
  import { usePermission } from '/@/hooks/web/usePermission';
  import { useRouter } from 'vue-router';
  import { useGlobSetting } from '/@/hooks/setting';

  export default defineComponent({
    name: 'JeeSiteHelp',
    components: { Icon, Tooltip, Badge },

    setup() {
      const { t } = useI18n();
      const { push } = useRouter();
      const { ctxPath } = useGlobSetting();
      // const { hasPermission } = usePermission();
      function handleHelp() {
        // if (hasPermission('sys:online:view')) {
        //   push('/sys/online/list');
        // }
        // window.open('http://www.baidu.com','_blank')
        window.open(`${ctxPath}/f`,'_blank')
      }
      return {
        t,
        handleHelp,
      };
    },
  });
</script>
